<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<TITLE>Txt2tags User Guide</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-iso-8859-1">
<LINK REL="Start" HREF="index.html">
<LINK REL="Contents" HREF="index.html">
<LINK REL="Prev" HREF="StatusofSupportedStructuresbyTarget.html">
<LINK REL="Next" HREF="PartIIInstall.html">
<STYLE TYPE="text/css"><!--
BODY { font-family: serif }
H1 { font-family: sans-serif }
H2 { font-family: sans-serif }
H3 { font-family: sans-serif }
H4 { font-family: sans-serif }
H5 { font-family: sans-serif }
H6 { font-family: sans-serif }
SUB { font-size: smaller }
SUP { font-size: smaller }
PRE { font-family: monospace }
--></STYLE>
<LINK REL="stylesheet" TYPE="text/css" HREF="userguide.css"></HEAD>
<BODY>
<A HREF="index.html">Contents</A>
<A HREF="StatusofSupportedStructuresbyTarget.html">Previous</A>
<A HREF="PartIIInstall.html">Next</A>
<HR NOSHADE>

<H2><A NAME="2_5">The Three User Interfaces: Gui, Web and Command Line</A>
</H2>
<P> As different users have different needs and environments, txt2tags
 is very flexible on how it runs.</P>
<P> There are three User Interfaces for the program, each one with its
 own purpose and features.</P>
<UL>
<LI><B>Gui</B>: Written in Tk, brings the windowing and clicking to
 txt2tags.</LI>
<LI><B>Web</B>: Written in PHP, allows users to run txt2tags on the
 browser, requiring no installation on the client side.</LI>
<LI><B>Command Line</B>: Written in Python, it's the program core. All
 features are available as command line options.</LI>
</UL>
 <A NAME="gui"></A>
<H3>Graphical Interface</H3>
<P> Since version 1.0, there is a nice Graphical Interface, that works
 on Linux, Windows, Mac and others. Just call txt2tags with the <CODE>
--gui</CODE> option to open it.</P>
<P> The interface is pretty simple and intuitive:</P>
<CENTER><IMG ALIGN="middle" ALT="" BORDER="0" HEIGHT="493" SRC="gui.png" WIDTH="482">
</CENTER>
<OL>
<LI>You locate the source .t2t file on the disk and its options are
 loaded.
<P></P>
</LI>
<LI>If the target is still empty, you must choose one.
<P></P>
</LI>
<LI>Then there are some options you may choose, but none of them are
 required.
<P></P>
</LI>
<LI>Finally, press the &quot;Convert!&quot; button.</LI>
</OL>
<P> A nice option is the &quot;<I>Dump to screen</I>&quot;, so you can check the
 resulting code on a separate window, no file is saved at all. When the
 code is OK, you uncheck it and the file will be saved.</P>
<P> The default interface colors can be changed on the <A HREF="CommandLineOptions.html#rc">
configuration file</A>, using the <CODE>%!guicolors</CODE> settings. For
 example:</P>
<PRE>
% set my own colors for the graphical interface (bg1, fg1, bg2, fg2)
%!guicolors: blue white brown yellow
</PRE>
<H3>Web Interface</H3>
<P> The Web Interface is up and running on the Internet at <A HREF="http://txt2tags.org/online.php">
http://txt2tags.org/online.php</A>, so you can use and test the program
 instantly, before download.</P>
<CENTER><IMG ALIGN="middle" ALT="" BORDER="0" HEIGHT="591" SRC="web.png" WIDTH="535">
</CENTER>
<P> One can also put this interface on the local intranet avoiding to
 install txt2tags in all machines.</P>
 <A NAME="cmdline"></A>
<H3>Command Line Interface</H3>
<P> For command line power users, the --help should be enough:</P>
<PRE>
Usage: txt2tags [OPTIONS] [infile.t2t ...]

      --targets       print a list of all the available targets and exit
  -t, --target=TYPE   set target document type. currently supported:
                      adoc, art, creole, dbk, doku, gwiki, html, lout, man,
                      mgp, moin, pm6, pmw, sgml, tex, txt, wiki, xhtml
  -i, --infile=FILE   set FILE as the input file name ('-' for STDIN)
  -o, --outfile=FILE  set FILE as the output file name ('-' for STDOUT)
      --encoding=ENC  set target file encoding (utf-8, iso-8859-1, etc)
      --toc           add an automatic Table of Contents to the output
      --toc-level=N   set maximum TOC level (depth) to N
      --toc-only      print the Table of Contents and exit
  -n, --enum-title    enumerate all titles as 1, 1.1, 1.1.1, etc
      --style=FILE    use FILE as the document style (like HTML CSS)
      --css-sugar     insert CSS-friendly tags for HTML/XHTML
      --css-inside    insert CSS file contents inside HTML/XHTML headers
  -H, --no-headers    suppress header and footer from the output
      --mask-email    hide email from spam robots. x@y.z turns &lt;x (a) y z&gt;
      --slides        format output as presentation slides (used by -t art)
      --width=N       set the output's width to N columns (used by -t art)
      --height=N      set the output's height to N rows (used by -t art)
  -C, --config-file=F read configuration from file F
      --gui           invoke Graphical Tk Interface
  -q, --quiet         quiet mode, suppress all output (except errors)
  -v, --verbose       print informative messages during conversion
  -h, --help          print this help information and exit
  -V, --version       print program version and exit
      --dump-config   print all the configuration found and exit
      --dump-source   print the document source, with includes expanded

Turn OFF options:
     --no-css-inside, --no-css-sugar, --no-dump-config, --no-dump-source,
     --no-encoding, --no-enum-title, --no-headers, --no-infile,
     --no-mask-email, --no-outfile, --no-quiet, --no-rc, --no-slides,
     --no-style, --no-targets, --no-toc, --no-toc-only

Example:
     txt2tags -t html --toc file.t2t

By default, converted output is saved to 'infile.&lt;target&gt;'.
Use --outfile to force an output file name.
If  input file is '-', reads from STDIN.
If output file is '-', dumps output to STDOUT.
</PRE>
<P> Please read the txt2tags man page for detailed information about
 options and command line use.</P>
<P> Examples:</P>
<TABLE>
<TR><TD><B>Convert to HTML</B></TD><TD><CODE>$ txt2tags -t html file.t2t</CODE>
</TD></TR>
<TR><TD><B>The same, using redirection</B></TD><TD><CODE>$ txt2tags -t
 html -o - file.t2t &gt; file.html</CODE></TD></TR>
<TR><TD></TD><TD>.</TD></TR>
<TR><TD><B>Including Table Of Contents</B></TD><TD><CODE>$ txt2tags -t
 html --toc file.t2t</CODE></TD></TR>
<TR><TD><B>And also, numbering titles</B></TD><TD><CODE>$ txt2tags -t
 html --toc --enum-title file.t2t</CODE></TD></TR>
<TR><TD></TD><TD>.</TD></TR>
<TR><TD><B>Contents quick view</B></TD><TD><CODE>$ txt2tags --toc-only
 file.t2t</CODE></TD></TR>
<TR><TD><B>Maybe enumerate them?</B></TD><TD><CODE>$ txt2tags --toc-only
 --enum-title file.t2t</CODE></TD></TR>
<TR><TD></TD><TD>.</TD></TR>
<TR><TD><B>One liners from STDIN</B></TD><TD><CODE>$ echo -e
 &quot;\n**bold**&quot; | txt2tags -t html --no-headers -</CODE></TD></TR>
<TR><TD><B>Testing Mask Email feature</B></TD><TD><CODE>$ echo -e
 &quot;\njohn.wayne@farwest.com&quot; | txt2tags -t txt --mask-email --no-headers
 -</CODE></TD></TR>
</TABLE>
 <A NAME="install"></A><HR NOSHADE>
<A HREF="index.html">Contents</A>
<A HREF="StatusofSupportedStructuresbyTarget.html">Previous</A>
<A HREF="PartIIInstall.html">Next</A>
</BODY>
</HTML>
